﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookiechk2 = Request.Cookies["Users"];

        if (Session["User"] != null && cookiechk2["User"] != null)
            {
                Login.Visible = false;
                Register.Visible = false;
                if (Session["User"] != null)
                {
                    Username.Text = "Welcome " + Session["User"] + "!";
                }
                else
                {
                    Username.Text = "Welcome " + cookiechk2["User"] + "!";
                }
            }
            else
            {
                Username.Visible = false;
                Logout.Visible = false;
                
            }

    }
}
